/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.util;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.faces.model.SelectItem;
import javax.faces.model.SelectItemGroup;
import queenb.net.entitybean.*;
import queenb.web.controller.QueenbController;
import queenb.web.crm.store.*;
import queenb.web.financial.store.H075Store;
import queenb.web.financial.store.T000Store;
import queenb.web.financial.store.T075Store;
import queenb.web.financial.store.T100Store;
import queenb.web.permission.store.Q400Store;
import queenb.web.product.store.S400Store;
import queenb.web.store.*;
import queenb.web.supplier.store.V220Store;
import queenb.web.timekeeper.store.N150Store;

/**
 *
 * @author ems
 */
public class ComboboxUtil extends QueenbController {
    
    public List<SelectItem> getSelectedV030forTour(int fv050) {
        V030Store store = new V030Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<N100> listCombV030 = store.combo_listoftabv030new(getLogin().getModule(), getLogin().getCompanyNo(),fv050,0,0,1000,0,0, getLogin().getUserName());

            Iterator ic = listCombV030.iterator();
            while (ic.hasNext()) {
                N100 n850 = (N100) ic.next();

                SelectItem item = new SelectItem(n850.getPn100(), n850.getHoten());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }
     public List<SelectItem> getSelectedV030forTourNew(int fv050) {
        V030Store store = new V030Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<N100> listCombV030 = store.combcurpks_combtabv030(getLogin().getModule(), getLogin().getCompanyNo(),fv050, getLogin().getUserName());

            Iterator ic = listCombV030.iterator();
            while (ic.hasNext()) {
                N100 n850 = (N100) ic.next();

                SelectItem item = new SelectItem(n850.getPn100(), n850.getHoten());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }
     
      public List<SelectItem> getSelectedV030forTourNewDD(int fv050) {
        V030Store store = new V030Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<N100> listCombV030 = store.combcurpks_combtabv030dd(getLogin().getModule(), getLogin().getCompanyNo(),0,fv050, getLogin().getUserName());

            Iterator ic = listCombV030.iterator();
            while (ic.hasNext()) {
                N100 n850 = (N100) ic.next();

                SelectItem item = new SelectItem(n850.getPn100(), n850.getHoten());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }
    
     public List<SelectItem> getSelectedM000Comb() {
        M000Store store = new M000Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<M000> listComb850 = store.COMBCURPKS_COMBTABM000(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listComb850.iterator();
            while (ic.hasNext()) {
                M000 n850 = (M000) ic.next();

                SelectItem item = new SelectItem(n850.getVal(), n850.getLabel());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }
    public List<SelectItem> getSelectedN850Comb() {
        N850Store store = new N850Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<N850> listComb850 = store.findAllN850ForCombo(getLogin().getModule(), 99, 0, getLogin().getUserName());

            Iterator ic = listComb850.iterator();
            while (ic.hasNext()) {
                N850 n850 = (N850) ic.next();

                SelectItem item = new SelectItem(n850.getVal(), n850.getLabel());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }
    
     public List<SelectItem> getSelectedC425Comb() {
        C425Store store = new C425Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<C425> listComb850 = store.combcurpks_combtabc425(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listComb850.iterator();
            while (ic.hasNext()) {
                C425 n850 = (C425) ic.next();

                SelectItem item = new SelectItem(n850.getVal(), n850.getLabel());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }
     
     public List<SelectItem> getSelectedC475Comb() {
        C475Store store = new C475Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<C475> listComb850 = store.combcurpks_combtabc475(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listComb850.iterator();
            while (ic.hasNext()) {
                C475 n850 = (C475) ic.next();

                SelectItem item = new SelectItem(n850.getVal(), n850.getLabel());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }

    // com bobox V100
    public List<SelectItem> getListComboV100() {
        V100Store store = new V100Store();
        List<SelectItem> listitem = new ArrayList<SelectItem>();
        try {
            List<N100> listV100 = store.VCURPKS_LISTOFTABV100(0, getLogin().getModule(), getLogin().getCompanyNo(), null);
            Iterator ic = listV100.iterator();
            while (ic.hasNext()) {
                N100 q000 = (N100) ic.next();

                SelectItem item = new SelectItem(q000.getVal(), q000.getLabel());
                listitem.add(item);
            }
            listitem.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception e) {
        }
        return listitem;
    }

    // Combobox For Tour
    public List<SelectItem> getlistCombForTour(int pnFV050) {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> selectItemN100 = new ArrayList<SelectItem>();
        try {
            List<N100> listCombT075 = store.comboboxForTour(getLogin().getModule(), getLogin().getCompanyNo(), pnFV050, getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();

                SelectItem item = new SelectItem(n100.getValint(), n100.getLabel());
                selectItemN100.add(item);
            }
            selectItemN100.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN100;

    }

    public List<SelectItem> getListComboQ000() {
        Q000Store store = new Q000Store();
        List<SelectItem> listitem = new ArrayList<SelectItem>();
        try {
            List<Q000> listq000 = store.getListQ000Combo(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getId(), getLogin().getUserName());
            Iterator ic = listq000.iterator();
            while (ic.hasNext()) {
                Q000 q000 = (Q000) ic.next();

                SelectItem item = new SelectItem(q000.getVal(), q000.getLabel());
                listitem.add(item);
            }
            listitem.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception e) {
        }
        return listitem;
    }

    public List<SelectItem> getListComboM250() {
        M250Store store = new M250Store();
        List<SelectItem> listitem = new ArrayList<SelectItem>();
        try {
            System.out.println("store.getComboboxM250(" + getLogin().getModule() + " , " + +getLogin().getCompanyNo() + " , " + getLogin().getFn850() + " , " + getLogin().getUserName());
            List<M250> listm250 = store.getComboboxM250(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getFn850(), getLogin().getUserName());
            Iterator ic = listm250.iterator();
            while (ic.hasNext()) {
                M250 q000 = (M250) ic.next();

                SelectItem item = new SelectItem(q000.getVal(), q000.getLabel());
                listitem.add(item);
            }
            listitem.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception e) {
        }
        return listitem;
    }

    public List<SelectItem> getlistCombN850FindId(int fn450) {
        N850Store store = new N850Store();
        List<SelectItem> selectItemN850 = new ArrayList<SelectItem>();
        try {
            List<N850> listComb850 = store.findAllN850ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), fn450, getLogin().getUserName());

            Iterator ic = listComb850.iterator();
            while (ic.hasNext()) {
                N850 n850 = (N850) ic.next();

                SelectItem item = new SelectItem(n850.getVal(), n850.getLabel());
                selectItemN850.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN850;

    }

    // Mối quan hệ
    public List<SelectItem> getlistCombN050() {
        N050Store store = new N050Store();
        List<SelectItem> selectItemN050 = new ArrayList<SelectItem>();
        try {
            List<N050> listCombT075 = store.findAllN050ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                N050 n050 = (N050) ic.next();

                SelectItem item = new SelectItem(n050.getVal(), n050.getLabel());
                selectItemN050.add(item);
            }
            selectItemN050.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN050;

    }

    // Quoocs gia
    public List<SelectItem> getlistCombN750() {
        N750Store store = new N750Store();
        List<SelectItem> selectItemN750 = new ArrayList<SelectItem>();
        try {
            List<N750> listCombT075 = store.findAllN750ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), 0, getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                N750 n750 = (N750) ic.next();

                SelectItem item = new SelectItem(n750.getVal(), n750.getLabel());
                selectItemN750.add(item);
            }
            selectItemN750.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN750;

    }
    // Quoocs gia

    public List<SelectItem> getlistCombN750DV() {
        N750Store store = new N750Store();
        List<SelectItem> selectItemN750 = new ArrayList<SelectItem>();
        try {
            List<N750> listCombT075 = store.findAllN750ForComboDV(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                N750 n750 = (N750) ic.next();

                SelectItem item = new SelectItem(n750.getVal(), n750.getLabel());
                selectItemN750.add(item);
            }
            selectItemN750.add(0, new SelectItem("0", "----"));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN750;

    }

    // Quoocs gia tru viet nam
    public List<SelectItem> getlistCombN750DVT() {
        N750Store store = new N750Store();
        List<SelectItem> selectItemN750 = new ArrayList<SelectItem>();
        try {
            List<N750> listCombT075 = store.findAllN750ForComboDV(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                N750 n750 = (N750) ic.next();
                if (n750.getVal() != 1) {
                    SelectItem item = new SelectItem(n750.getVal(), n750.getLabel());
                    selectItemN750.add(item);
                }

            }
            selectItemN750.add(0, new SelectItem("0", getResourceString("select_country")));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN750;

    }
    // Folder tìa liệu

    public List<SelectItem> getlistCombF000() {
        F000Store store = new F000Store();
        List<SelectItem> selectItemN750 = new ArrayList<SelectItem>();
        try {
            List<F000> listCombF000 = store.findAllF000ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listCombF000.iterator();
            while (ic.hasNext()) {
                F000 n750 = (F000) ic.next();

                SelectItem item = new SelectItem(n750.getVal(), n750.getLabel());
                selectItemN750.add(item);
            }
            selectItemN750.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN750;

    }

    // Nguồn thông tin
    // Quoocs gia
    public List<SelectItem> getlistCombK330(String Str) {
        K330Store store = new K330Store();
        List<SelectItem> selectItemN750 = new ArrayList<SelectItem>();
        try {
            List<K330> listCombT075 = store.findAllK350ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), 0, Str, getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                K330 k330 = (K330) ic.next();

                SelectItem item = new SelectItem(k330.getVal(), k330.getLabel());
                selectItemN750.add(item);
            }
            selectItemN750.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }

        return selectItemN750;

    }

    // Status
    // Quoocs gia
    public List<SelectItem> getlistCombK300(String str) {
        K300Store store = new K300Store();
        List<SelectItem> selectItemN750 = new ArrayList<SelectItem>();
        try {
            List<K300> listCombT075 = store.findAllK300ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), 0, str, getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                K300 k300 = (K300) ic.next();

                SelectItem item = new SelectItem(k300.getVal(), k300.getLabel());
                selectItemN750.add(item);
            }
            selectItemN750.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }

        return selectItemN750;

    }

    public List<SelectItem> getlistCombM200() {
        M200Store store = new M200Store();
        List<SelectItem> selectItemM200 = new ArrayList<SelectItem>();
        try {
            List<M200> listCombM200 = store.getListM200All(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getId(), getLogin().getUserName());

            Iterator ic = listCombM200.iterator();
            while (ic.hasNext()) {
                M200 k300 = (M200) ic.next();

                SelectItem item = new SelectItem(k300.getVal(), k300.getLabel());
                selectItemM200.add(item);
            }
            selectItemM200.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }

        return selectItemM200;

    }

    // Mục đích thanh toan T075
    public List<SelectItem> getlistCombT075() {
        T075Store store = new T075Store();
        List<SelectItem> selectItemT075 = new ArrayList<SelectItem>();
        try {
            List<T075> listCombT075 = store.getListCombH075(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());

            Iterator ic = listCombT075.iterator();
            while (ic.hasNext()) {
                T075 t075 = (T075) ic.next();

                SelectItem item = new SelectItem(t075.getVal(), t075.getLabel());
                selectItemT075.add(item);
            }
            selectItemT075.add(0, new SelectItem("0", getResourceString("please_select")));
        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemT075;

    }

    public List<SelectItem> getlistCombN100FindId(int fn850) {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> selectItemN100 = new ArrayList<SelectItem>();
        try {
            List<N100> listComb850 = store.getAllListTabN100R(getLogin().getModule(), getLogin().getCompanyNo(), 0, 0, fn850, getLogin().getUserName());

            Iterator ic = listComb850.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                System.out.println("----------n850 tungggggggggggg---------" + n100.getVal() + n100.getLabel());
                SelectItem item = new SelectItem(n100.getVal(), n100.getLabel());
                selectItemN100.add(item);
            }

        } catch (Exception ex) {
        }
        // selectItemN850.add(0, new SelectItem(0, getResourceString("please_select")));
        return selectItemN100;

    }

    public List<SelectItem> getSelectedN900Calendar(int fn850) {

        N900Store n900Store = new N900Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N900> listItemN900 = n900Store.getFindN900ByCombN850(getLogin().getModule(), 99, fn850, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N900 n900 = (N900) ic.next();
                SelectItem item = new SelectItem(n900.getVal(), n900.getVal2());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }
        // listItemed.add(0,new SelectItem("0", getResourceString("please_select")));
        return listItemed;

    }

// Tung dung ham de lam form gnhi phep
    public List<SelectItem> getSelectedN900CombN500(int fn850) {

        N900Store n900Store = new N900Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N900> listItemN900 = n900Store.getFindN900ByCombN850(getLogin().getModule(), 99, fn850, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N900 n900 = (N900) ic.next();
                SelectItem item = new SelectItem(n900.getVal(), n900.getLabel());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }
        // listItemed.add(0,new SelectItem("0", getResourceString("please_select")));
        return listItemed;

    }

    public List<SelectItem> getSelectedN900Comb(int fn850) {

        N900Store n900Store = new N900Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N900> listItemN900 = n900Store.getFindN900ByCombN850(getLogin().getModule(), 99, fn850, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N900 n900 = (N900) ic.next();
                SelectItem item = new SelectItem(n900.getVal2(), n900.getLabel());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }
        // listItemed.add(0,new SelectItem("0", getResourceString("please_select")));
        return listItemed;

    }

    // convert employee
    public List<SelectItem> getSelectedN900CombConvert(int fn850) {

        N900Store n900Store = new N900Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N900> listItemN900 = n900Store.getFindN900ByCombN850(getLogin().getModule(), 99, fn850, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N900 n900 = (N900) ic.next();
                SelectItem item = new SelectItem(n900.getVal2(), n900.getLabel());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }
        listItemed.add(0, new SelectItem("0", getResourceString("please_select")));
        return listItemed;

    }

    public List<SelectItem> getSelectedC650RComb(String fc150) {

        C650Store c650Store = new C650Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<C650> lst = c650Store.COMBTABC650(getLogin().getModule(), getLogin().getCompanyNo(), fc150, 0, getLogin().getUserName());
            Iterator ic = lst.iterator();

            while (ic.hasNext()) {
                C650 c650 = (C650) ic.next();
                SelectItem item = new SelectItem(c650.getFn100(), c650.getHoten());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }
        // listItemed.add(0,new SelectItem("0", getResourceString("please_select")));
        return listItemed;

    }

    public List<SelectItem> getSelectedN900CombID(int fn850) {

        N900Store n900Store = new N900Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N900> listItemN900 = n900Store.getFindN900ByCombN850(getLogin().getModule(), 99, fn850, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N900 n900 = (N900) ic.next();
                SelectItem item = new SelectItem(n900.getVal(), n900.getLabel());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }
        // listItemed.add(0,new SelectItem("0", getResourceString("please_select")));
        return listItemed;

    }

    public List<SelectItem> getSelectedN550Comb() {

        N550Store store = new N550Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N550> listItemN900 = store.findAllN550ForCombo(getLogin().getModule(), 99, 1, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N550 n550 = (N550) ic.next();
                SelectItem item = new SelectItem(n550.getPn550(), n550.getNv552());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }

        return listItemed;

    }

    // nganh nghe cho nha CC
    public List<SelectItem> getSelectedN550CombCC() {

        N550Store store = new N550Store();
        List<SelectItem> listItemed = new ArrayList<SelectItem>();
        try {
            List<N550> listItemN900 = store.findAllN550ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), 0, getLogin().getUserName());
            Iterator ic = listItemN900.iterator();

            while (ic.hasNext()) {
                N550 n550 = (N550) ic.next();
                SelectItem item = new SelectItem(n550.getPn550(), n550.getNv552());
                listItemed.add(item);
            }
        } catch (Exception e) {
        }

        return listItemed;

    }

    public List<SelectItem> getListCombK100() {
        K100Store store = new K100Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<K100> listK100C = store.getListCombK100(getLogin().getModule(), getLogin().getCompanyNo(), 2, getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                K100 k100 = (K100) ic.next();
                SelectItem item = new SelectItem(k100.getVal(), k100.getLabel());
                listItem.add(item);

            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombK100DV(int FN750, int FNA000, int FV200) {
        K100Store store = new K100Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<K100> listK100C = store.getListCombK100DV(getLogin().getModule(), getLogin().getCompanyNo(), FN750, FNA000, FV200, getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                K100 k100 = (K100) ic.next();
                SelectItem item = new SelectItem(k100.getVal(), k100.getLabel());
                listItem.add(item);

            }
            listItem.add(0, new SelectItem("0", getResourceString("select_ncc")));
            return listItem;
        } catch (Exception ex) {
            List<SelectItem> list = new ArrayList<SelectItem>();
            list.add(0, new SelectItem("0", getResourceString("select_ncc")));
            return list;
        }
    }

    public List<SelectItem> getListCombB670() {
        B630Store store = new B630Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<B630> listK100C = store.getListCombB670(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                B630 b630 = (B630) ic.next();
                SelectItem item = new SelectItem(b630.getVal(), b630.getLabel());
                listItem.add(item);

            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombN100D(int fk100) {
        CustomerStore store = new CustomerStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            System.out.println(getLogin().getModule() + "," + getLogin().getCompanyNo() + "," + fk100 + "," + getLogin().getUserName());
            List<N100> listK100C = store.getListCombN100D(getLogin().getModule(), getLogin().getCompanyNo(), fk100, getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                SelectItem item = new SelectItem(n100.getVal1(), n100.getLabel1());
                listItem.add(item);

            }
            // listItem.add(0,new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }
    // hàm combobox S400

    public List<SelectItem> getListCombS400() {
        S400Store store = new S400Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {

            List<S400> listS400 = store.LISTOFTABS400COMBO(getLogin().getModule(), getLogin().getCompanyNo(), 0, 0, getLogin().getUserName());
            Iterator ic = listS400.iterator();
            while (ic.hasNext()) {
                S400 s400 = (S400) ic.next();
                SelectItem item = new SelectItem(s400.getVal(), s400.getLabel());
                listItem.add(item);

            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombN100F() {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {

            List<N100> listK100C = store.getListComN100Project(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                SelectItem item = new SelectItem(n100.getVal(), n100.getLabel());
                listItem.add(item);

            }
            // listItem.add(0,new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }
    public List<SelectItem> getListCombN100FF() {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {

            List<N100> listK100C = store.getListComN100Project(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                SelectItem item = new SelectItem(n100.getVal(), n100.getLabel2());
                listItem.add(item);

            }
            // listItem.add(0,new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }
    // Hàm get Dữ Liệu nhân viên dành cho Form project

    public List<SelectItem> getListCombN100Project() {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N100> listK100C = store.getListComN100Project(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                SelectItem item = new SelectItem(n100.getLabel2(), n100.getLabel());
                listItem.add(item);

            }

            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombN100() {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N100> listK100C = store.getListComN100Project(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                SelectItem item = new SelectItem(n100.getLabel3(), n100.getLabel());
                listItem.add(item);

            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombN100ofN500() {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N100> listK100C = store.getListComN100Project(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                SelectItem item = new SelectItem(n100.getVal(), n100.getLabel());
                listItem.add(item);

            }
            // listItem.add(0,new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombN100Pro() {
        EmployeeStore store = new EmployeeStore();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N100> listK100C = store.getListComN100Project(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            listItem.add(0, new SelectItem("ALL", getResourceString("please_select")));
            Iterator ic = listK100C.iterator();
            while (ic.hasNext()) {
                N100 n100 = (N100) ic.next();
                if (n100.getLabel2() != null && !n100.getLabel2().equals("")) {
                    SelectItem item = new SelectItem(n100.getLabel2().replace(" ", ""), n100.getLabel());
                    listItem.add(item);
                }

            }

            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombQ300() {
        Q400Store store = new Q400Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<Q400> listq400 = store.CombQ300(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listq400.iterator();
            while (ic.hasNext()) {
                Q400 q400 = (Q400) ic.next();
                SelectItem item = new SelectItem(q400.getVal(), q400.getLabel());
                listItem.add(item);

            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListComBV200() {
        V200Store v200Store = new V200Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<V200> listv200 = v200Store.getListCombV200(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listv200.iterator();
            while (ic.hasNext()) {
                V200 v200 = (V200) ic.next();
                SelectItem item = new SelectItem(v200.getVal(), v200.getLabel());
                listItem.add(item);

            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListComBV200DV(int pnFN750, int pnFA000, int pnFK100) {
        V200Store v200Store = new V200Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<V200> listv200 = v200Store.getListCombV200DV(getLogin().getModule(), getLogin().getCompanyNo(), pnFN750, pnFA000, pnFK100, getLogin().getUserName());
            Iterator ic = listv200.iterator();
            while (ic.hasNext()) {
                V200 v200 = (V200) ic.next();
                SelectItem item = new SelectItem(v200.getVal(), v200.getLabel());
                listItem.add(item);

            }
            listItem.add(0, new SelectItem("0", getResourceString("select_ldv")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListComBN450() {
        N450Store n450Store = new N450Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N450> listn450 = n450Store.findAllN450ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listn450.iterator();
            while (ic.hasNext()) {
                N450 n450 = (N450) ic.next();
                SelectItem item = new SelectItem(n450.getVal(), n450.getLabel());
                listItem.add(item);

            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombS200() {
        S200Store s200Store = new S200Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<S200> listS200 = s200Store.getListS200Comb(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listS200.iterator();
            while (ic.hasNext()) {
                S200 s200 = (S200) ic.next();
                SelectItem item = new SelectItem(s200.getVal(), s200.getLabel());
                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // combo tinhr thanh pho
    public List<SelectItem> getListCombA000(int id) {
        A000Store s200Store = new A000Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<A000> listS200 = s200Store.findAllA000ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), id, 0, getLogin().getUserName());
            Iterator ic = listS200.iterator();
            while (ic.hasNext()) {
                A000 a000 = (A000) ic.next();
                SelectItem item = new SelectItem(a000.getVal(), a000.getLabel1());
                listItem.add(item);
            }
            // listItem.add(0,new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // combo tinhr thanh pho - lay tat ca
    public List<SelectItem> getListCombA000DV(int id) {
        System.out.println("--D: getListCombA000DV: " + id);
        A000Store s200Store = new A000Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<A000> listS200 = s200Store.getListCityByCountryIdDV(getLogin().getModule(), getLogin().getCompanyNo(), id, getLogin().getUserName());
            Iterator ic = listS200.iterator();
            while (ic.hasNext()) {
                A000 a000 = (A000) ic.next();
                SelectItem item = new SelectItem(a000.getVal(), a000.getLabel());
                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("select_city")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombA000_S(int id) {
        System.out.println("--D: getListCombA000DV: " + id);
        A000Store s200Store = new A000Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<A000> listS200 = s200Store.getListCityByCountryIdDV(getLogin().getModule(), getLogin().getCompanyNo(), id, getLogin().getUserName());
            Iterator ic = listS200.iterator();
            while (ic.hasNext()) {
                A000 a000 = (A000) ic.next();
                SelectItem item = new SelectItem(a000.getVal(), a000.getLabel());
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombA000_SP(int id) {
//        System.out.println("--D: getListCombA000DV: " + id);
        A000Store s200Store = new A000Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        String option;

        try {
            List<A000> listS200 = s200Store.getListCityAndCountry(getLogin().getModule(), getLogin().getCompanyNo(), id, getLogin().getUserName());
            String st;
            SelectItemGroup group = new SelectItemGroup();
            if (listS200 != null && listS200.size() > 1) {
                st = listS200.get(0).getNv754();
                group = new SelectItemGroup(st);
            } else {
                st = "";
            }
            List<SelectItem> options = new ArrayList<SelectItem>();
            if (listS200 != null && listS200.size() > 1) {
                for (int i = 0; i < listS200.size(); i++) {
//                    System.out.println("D:- st: " + st);
//                    System.out.println("D:- listS200.get(i).getNv754(): " + listS200.get(i).getNv754());
//                    System.out.println("D:- !listS200.get(i).getNv754().equals(st): " + !listS200.get(i).getNv754().equals(st));
                    if (!listS200.get(i).getNv754().equals(st)) {
                        group.setSelectItems(options.toArray(new SelectItem[options.size()]));
                        listItem.add(group);
                        group = new SelectItemGroup(listS200.get(i).getNv754());
                        st = listS200.get(i).getNv754();
                        options.clear();
                        options.add(new SelectItem(listS200.get(i).getVal(), listS200.get(i).getLabel()));

                    } else {
                        options.add(new SelectItem(listS200.get(i).getVal(), listS200.get(i).getLabel()));

                    }

                    if (i == listS200.size() - 1) {
                        group.setSelectItems(options.toArray(new SelectItem[options.size()]));
                        listItem.add(group);
                    }

                }
            }




//            Iterator ic = listS200.iterator();
//            while (ic.hasNext()) {
//                A000 a000 = (A000) ic.next();
//                options = new ArrayList<SelectItem>();
//
//                SelectItemGroup group1 = new SelectItemGroup("Group 1");
//                group1.setSelectItems(new SelectItem[]{
//                            new SelectItem("Group 1 Value 1", "Group 1 Label 1"),
//                            new SelectItem("Group 1 Value 2", "Group 1 Label 2"),
//                            new SelectItem("Group 1 Value 3", "Group 1 Label 3")
//                        });
//                options.add(group1);
//
//                SelectItemGroup group2 = new SelectItemGroup("Group 2");
//                group2.setSelectItems(new SelectItem[]{
//                            new SelectItem("Group 2 Value 1", "Group 2 Label 1"),
//                            new SelectItem("Group 2 Value 2", "Group 2 Label 2"),
//                            new SelectItem("Group 2 Value 3", "Group 2 Label 3")
//                        });
//                options.add(group2);
//
//               
//                SelectItem item = new SelectItem(a000.getVal(), a000.getLabel());
//                listItem.add(item);
//            }
            return listItem;
        } catch (Exception ex) {
            System.out.println("D: error from get list city from product Tour: " + ex.getMessage());
            return new ArrayList<SelectItem>();
        }

    }
    //Dành cho quản lí dự án; Chuyên môn cong việc

    public List<SelectItem> getListCombS200Project() {
        S200Store s200Store = new S200Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<S200> listS200 = s200Store.getListS200Comb(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listS200.iterator();
            while (ic.hasNext()) {
                S200 s200 = (S200) ic.next();
                SelectItem item = new SelectItem(s200.getVal(), s200.getLabel());
                listItem.add(item);
            }
            //listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // Lấy danh sách Dự Án
    public List<SelectItem> getListCombB050() {
        B050Store b050Store = new B050Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<B050> listB050 = b050Store.listCombbB050(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listB050.iterator();
            while (ic.hasNext()) {
                B050 b050 = (B050) ic.next();
                SelectItem item = new SelectItem(b050.getVal(), b050.getLabel());
                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // Lấy danh sách danh mục công việc
    public List<SelectItem> getListCombS250() {
        S250Store s250Store = new S250Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<S250> listB050 = s250Store.getListCombS250(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listB050.iterator();
            while (ic.hasNext()) {
                S250 s250 = (S250) ic.next();
                SelectItem item = new SelectItem(s250.getVal(), s250.getLabel());
                listItem.add(item);
            }
            // listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // Lấy danh sách chức vụ của nhân viên
    public List<SelectItem> getListCombN250() {
        N250Store n250Store = new N250Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N250> listN250 = n250Store.getListCombN250(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listN250.iterator();
            while (ic.hasNext()) {
                N250 n250 = (N250) ic.next();
                SelectItem item = new SelectItem(n250.getVal(), n250.getLabel());
                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // Lấy danh sách FC550
    public List<SelectItem> getListCombC550() {
        C550Store c550Store = new C550Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<C550> listC550 = c550Store.listCombbC550(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listC550.iterator();
            while (ic.hasNext()) {
                C550 c550 = (C550) ic.next();
                SelectItem item = new SelectItem(c550.getVal(), c550.getLabel());
                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<V500> autocomplete(Object suggest) {
        V500Store v500Store = new V500Store();
        String pref = (String) suggest;
        ArrayList< V500> result = new ArrayList< V500>();
        List<V500> listV500 = v500Store.getListCombV050SGT(getLogin().getModule(), getLogin().getCompanyNo(), null, "T", getLogin().getUserName());

        Iterator< V500> iterator = listV500.iterator();
        while (iterator.hasNext()) {
            V500 elem = ((V500) iterator.next());
            if ((elem.getLabel() != null && elem.getLabel().toLowerCase().indexOf(pref.toLowerCase()) == 0) || "".equals(pref)) {
                result.add(elem);
            }
        }
        return result;
    }

    //get list V500
    public List<V500> getListV500() {
        V500Store v500Store = new V500Store();
        List<V500> listV500 = v500Store.getListCombV050SGT(getLogin().getModule(), getLogin().getCompanyNo(), null, "T", getLogin().getUserName());
        return listV500;
    }
    // Tung lam Sale   

    public List<SelectItem> getListCombV050SGT() {
        V500Store v500Store = new V500Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<V500> listV500 = v500Store.getListCombV050SGT(getLogin().getModule(), getLogin().getCompanyNo(), null, "T", getLogin().getUserName());
            Iterator ic = listV500.iterator();
            while (ic.hasNext()) {
                V500 v500 = (V500) ic.next();

                SelectItem item = new SelectItem(v500.getVal(), v500.getLabel());


                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<SelectItem> getListCombV050SGTCN() {
        V500Store v500Store = new V500Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<V500> listV500 = v500Store.getListCombV050SGT(getLogin().getModule(), getLogin().getCompanyNo(), null, "T", getLogin().getUserName());
            Iterator ic = listV500.iterator();
            while (ic.hasNext()) {
                V500 v500 = (V500) ic.next();

                SelectItem item = new SelectItem(v500.getVal(), v500.getLabel1());


                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    // Hien combobox tren form them cong viec cua ManagerSale
    public List<SelectItem> getListCombV050Sale() {
        V050Store v050Store = new V050Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<V050> listV050 = v050Store.getListCombV050SGT(getLogin().getModule(), getLogin().getCompanyNo(), null, "S", getLogin().getUserName());
            Iterator ic = listV050.iterator();
            while (ic.hasNext()) {
                V050 v050 = (V050) ic.next();

                SelectItem item = new SelectItem(v050.getVal(), v050.getLabel());


                listItem.add(item);
            }
            listItem.add(0, new SelectItem("0", getResourceString("please_select")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }

    }

    public List<V500> getListV500ComAll(String vv501) {
        V500Store v500Store = new V500Store();
        List<V500> listV500 = v500Store.getListCombV050SGT(getLogin().getModule(), getLogin().getCompanyNo(), vv501, "T", getLogin().getUserName());

        return listV500;
    }

    public List<SelectItem> getListCombK400() {
        K400Store store = new K400Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<Q400> listq400 = store.CombK400(getLogin().getModule(), getLogin().getCompanyNo(), 0, getLogin().getUserName());
            Iterator ic = listq400.iterator();
            while (ic.hasNext()) {
                Q400 q400 = (Q400) ic.next();
                SelectItem item = new SelectItem(q400.getVal(), q400.getLabel());
                listItem.add(item);

            }
            listItem.add(0, new SelectItem("0", getResourceString("please_all")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombK400F(String KV402) {
        K400Store store = new K400Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<Q400> listq400 = store.COMBTABK400F(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getId(), 0, KV402, getLogin().getUserName());
            Iterator ic = listq400.iterator();
            while (ic.hasNext()) {
                Q400 q400 = (Q400) ic.next();
                SelectItem item = new SelectItem(q400.getVal(), q400.getLabel());
                listItem.add(item);

            }
            listItem.add(0, new SelectItem("0", getResourceString("please_all")));
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombQ100() {
        Q100Store q100Store = new Q100Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<Q100> listQ100 = q100Store.getListCombQ100(getLogin().getModule(), getLogin().getCompanyNo(), 0, getLogin().getUserName());
            Iterator ic = listQ100.iterator();
            while (ic.hasNext()) {
                Q100 q100 = (Q100) ic.next();
                SelectItem item = new SelectItem(q100.getVal(), q100.getLabel());
                listItem.add(item);
            }
            return listItem;

        } catch (Exception ex) {
            return null;

        }
    }

    //COMB C250
    public List<SelectItem> getListCombC250() {
        N150Store n150Store = new N150Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N150> listN150 = n150Store.getListCombC250(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listN150.iterator();
            while (ic.hasNext()) {
                N150 n150 = (N150) ic.next();
                SelectItem item = new SelectItem(n150.getVal(), n150.getLabel());
                listItem.add(item);
            }
            return listItem;

        } catch (Exception ex) {
            return null;

        }
    }

    //COMB N000
    public List<SelectItem> getListCombN000() {
        N000Store n000Store = new N000Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<N000> listN000 = n000Store.findAllN850ForCombo(getLogin().getModule(), getLogin().getCompanyNo(), null, getLogin().getUserName());
            Iterator ic = listN000.iterator();
            while (ic.hasNext()) {
                N000 n150 = (N000) ic.next();
                SelectItem item = new SelectItem(n150.getVal(), n150.getLabel());
                listItem.add(item);
            }
            return listItem;

        } catch (Exception ex) {
            return null;

        }
    }

    //H075
    public List<SelectItem> getListCombH075() {
        H075Store h075Store = new H075Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<H075> listH075 = h075Store.getListCombH075(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listH075.iterator();
            while (ic.hasNext()) {
                H075 h075 = (H075) ic.next();
                SelectItem item = new SelectItem(h075.getVal(), h075.getLabel());
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    //T100
    public List<SelectItem> getListCombT100() {
        T100Store t100Store = new T100Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<T100> listH075 = t100Store.getListCombT100(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listH075.iterator();
            while (ic.hasNext()) {
                T100 t100 = (T100) ic.next();
                SelectItem item = new SelectItem(t100.getVal(), t100.getLabel());
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombT100CN() {
        T000Store t100Store = new T000Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<T000> listH075 = t100Store.getListCombT000CN(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listH075.iterator();
            while (ic.hasNext()) {
                T000 t000 = (T000) ic.next();

                SelectItem item = new SelectItem(t000.getVal(), t000.getLabel());
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListCombT100b() {
        T100Store t100Store = new T100Store();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            List<T100> listH075 = t100Store.getListCombT100b(getLogin().getModule(), getLogin().getCompanyNo(), getLogin().getUserName());
            Iterator ic = listH075.iterator();
            while (ic.hasNext()) {
                T100 t100 = (T100) ic.next();
                SelectItem item = new SelectItem(t100.getVal(), t100.getLabel());
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListDates() {

        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            String lable = "";
            for (int i = 1; i < 32; i++) {
                if (i < 10) {
                    lable = "0" + i;
                } else {
                    lable = "" + i;
                }
                SelectItem item = new SelectItem(i, lable);
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListMonths() {

        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            String lable = "";
            for (int i = 1; i < 13; i++) {
                if (i < 10) {
                    lable = "0" + i;
                } else {
                    lable = "" + i;
                }
                SelectItem item = new SelectItem(i, lable);
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }

    public List<SelectItem> getListYears() {
        Date d = new Date();
        List<SelectItem> listItem = new ArrayList<SelectItem>();
        try {
            String lable = "";
            for (int i = (1900 + d.getYear()); i < (1900 + d.getYear() + 4); i++) {
                if (i < 10) {
                    lable = "0" + i;
                } else {
                    lable = "" + i;
                }
                SelectItem item = new SelectItem(i, lable);
                listItem.add(item);
            }
            return listItem;
        } catch (Exception ex) {
            return null;
        }
    }
}
